package com.guigu.tms.manager.controller.zhh;

import com.github.pagehelper.PageInfo;
import com.guigu.tms.commons.base.entity.GoodsType;
import com.guigu.tms.commons.base.feign.GoodsTypeFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("goodsType")
public class GoodsTypeController {
    @Autowired
    GoodsTypeFeignClient client;
    @GetMapping("/GoodsTypeQuery")
    public PageInfo<GoodsType> GoodsTypeQuery(@RequestParam("name")String name, @RequestParam("TruckTypeId") String TruckTypeId, @RequestParam("num") Integer num, @RequestParam("size") Integer size){
        return client.GoodsTypeQuery(name, TruckTypeId, num, size);
    }

    @RequestMapping("/deleteGoodsType")
    public int deleteGoodsType(@RequestParam("id") int id){
      return client.deleteGoodsType(id);
    }

    @RequestMapping("/updateById")
   public boolean updateById(@RequestBody GoodsType goodsType){
      return   client.updateById(goodsType);
    }
    //添加
    @PostMapping("/save")
    public boolean save(@RequestBody GoodsType entity){
        return client.save(entity);
    }
}
